"""
少量提示词示例
"""
from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate

from models import get_ds_model_client

example_prompt_template = PromptTemplate.from_template("算式： {sinput} 值： {soutput} 类型： {sdescription} ")
examples=[
    {"sinput": "2+2", "soutput": "4", "sdescription": "加法运算"},
    {"sinput": "5-2", "soutput": "3", "sdescription": "减法运算"},
]

prompt = FewShotPromptTemplate(example_prompt=example_prompt_template,
                                 examples=examples,
                                 prefix="请根据以下例子回答问题：",
                                 suffix="现在给你一个算式:{input}，值:{output}，告诉我类型： ",
                                 input_variables=["input", "output"])
print(prompt.format(input="2*5", output="10"))

client = get_ds_model_client()
print(client.invoke(prompt.format(input="2*5", output="10")))
